#include<iostream>
#include"processpool.cc"
#include"task.hpp"

int main()
{
    LoadTask();//一定要在进程创建之前加载，不然线程会非法访问
    ProcessPool p;
    int n=10;
    while(1)
    {
        std::cout<<"enter-> ";
        int i=0;
        std::cin>>i;
        // Flush Print DownLoad
        switch(i)
        {
            case 0:p.Enqueue(Flush);
            break;
            case 1:p.Enqueue(Print);
            break;
            case 2:p.Enqueue(DownLoad);
            break;
            default:
            std::cout<<"选择错误，重新选择"<<std::endl;
            break;
        }    
    }

    return 0;
}